<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="0" />
<title>仪器设备</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中 -->
<%-- ui tabs --%>

<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css" rel="stylesheet" />
<script>
$(document).ready(function(){
	$("#addLabsequipment").click(
			function() {
				var url = "labsequipment!input.action?organizationId=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}";
				mm = showDialogWindow(url);
					if (mm != null) {
						if ($.browser.msie) {
							document.getElementById("labsequipment").click();																    		   
			    		}else{
							window.location.reload();										
			    		}
					}
			});
		$("#cloBtn").click(function(){
			window.close();
		});	
});

function updateLabs(url){
	 mm =showDialogWindow(url);
	};
	
	function deleteLabs(url){
		$.ajax({ url: url, context: document.body, dataType:'text', success: function(msg){
			if("1"==msg){
				if ($.browser.msie) {
					document.getElementById("labsequipment").click();																    		   
	    		}else{
					window.location.reload();										
	    		}
			}else{
				alert("系统出错!");
			}
		}});				
		};
</script>
</head>
<body>
<form action="${ctx}/project/labs/labsequipment.action" method="get" id="mainForm"
	class='yform'>
<div id="tabs" class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all ui-sortable">
	<c:if test="${typeId == '1' }">
	<li><a id="build" class="ui-state-default ui-corner-top "
		href="${ctx}/project/labs/build!input.action?projectId=${projectId}&contractKind=${typeId}&decorator=${param.decorator}&confirm=${param.confirm}">单位信息</a></li>
	</c:if>
	<c:if test="${typeId != '1' }">
	<li><a id="build" class="ui-state-default ui-corner-top "
		href="${ctx}/project/labs/organization!input.action?id=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}&decorator=${param.decorator}&confirm=${param.confirm}">单位信息</a></li>
	</c:if>
	<li><a class="ui-state-default ui-corner-top"
		href="${ctx}/project/labs/qualification.action?organizationId=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}&decorator=${param.decorator}&confirm=${param.confirm}">单位资质</a></li>
	<li><a id="deptMan" class="ui-state-default ui-corner-top"
		href="${ctx}/project/labs/department.action?deptId=${deptId}&projectId=${projectId}&typeId=${typeId}&organizationId=${organizationId}&decorator=${param.decorator}&confirm=${param.confirm}">部门设置</a></li>
	<li><a class="ui-state-default ui-corner-top " href="${ctx}/project/labs/userdepartment.action?organizationId=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}&decorator=${param.decorator}&confirm=${param.confirm}">人员情况</a></li>
	
	<li><a id="labsequipment" class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active" href="${ctx}/project/labs/labsequipment.action?organizationId=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}&decorator=${param.decorator}&confirm=${param.confirm}">仪器设备</a></li>
	<li><a id="labsscope" class="ui-state-default ui-corner-top" href="${ctx}/project/labs/labsscope.action?organizationId=${organizationId}&projectId=${projectId}&typeId=${typeId}&deptId=${deptId}&decorator=${param.decorator}&confirm=${param.confirm}">业务范围</a></li>
</ul>
<table id="contentTable">
	<tr>
		<th>序号</th>
		<th>名称</th>
		<th>型号规格</th>
		<th>生产产家</th>
		<th>操作</th>
	</tr>
	<c:forEach items="${page.result}" var="labsequipment" varStatus="status">
		<tr>
			<td>${status.count}</td>
			<td>${labsequipment.name}</td>
			<td>${labsequipment.model}</td>
			<td>${labsequipment.brand}</td>
			<td><a href="#" onclick="updateLabs('${ctx }/project/labs/labsequipment!input.action?id=${labsequipment.id }')">修改</a>
			<a href="#" onclick="deleteLabs('${ctx }/project/labs/labsequipment!deleteLabs.action?id=${labsequipment.id }')">删除</a></td></tr>
	</c:forEach>
</table>
<jsp:include page="/common/page.jsp" />
<div style="display: none">
	<input type="text"  name="organizationId" value="${param.organizationId}"/>
	<input type="text"  name="projectId" value="${param.projectId}"/>
	<input type="text"  name="tyepId" value="${param.typeId }"/>
	<input type="text"  name="deptId" value="${param.deptId }"/>
	<input type="text"  name="decorator" value="${param.decorator }"/>
	<input type="text"  name="confirm" value="${param.confirm }"/>
</div>
<div class="type-button">
	<input   type="button" class="submit" id="addLabsequipment" value="增加" />
	<c:if test="${fn:length(param.decorator)==0}">
	<input id="cloBtn"  type="button"   value="关闭" class="reset" />
	</c:if>
	</div>
</div>
</form>
</body>
</html>
